<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
    <style>
        
    </style>
</head>
<body>
    <div class="aaa">

    </div>
    <script>
        //链式调用的原型就是返回this让自己可以再次调用里面的方法
        function aa(){}
        aa.prototype.status = false;
        aa.prototype.change = function(){
            this.status = true;
            return this;
        };
        aa.prototype.say = function(){
            console.log('saysaysaysaysay');
            return this;
        }
        
        let a = new aa();
        a.change().say();//status:true  saysaysaysaysay

        let my = {
            status:false,
            name:'rmx',
            change(){
                this.status = true;
                return this;                
            },
            say(){
                console.log('mymymymymymy');
                return this;
            }
        }
        my.change().say();//status:true mymymymymymy
    </script>
</body>
</html>